import org.apache.velocity.Template;
import org.apache.velocity.VelocityContext;
import org.apache.velocity.app.Velocity;
import org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader;

import java.io.*;
import java.util.Arrays;

public class vm {

    public static void main(String[] args) {


        Velocity.setProperty("file.resource.loader.class", ClasspathResourceLoader.class.getName());
        VelocityContext context = new VelocityContext();
        context.put("list", Arrays.asList("我", "你"));
        Template template = Velocity.getTemplate("/example.vm");
        Writer writer=new StringWriter();
        template.merge(context, writer);
        System.out.println(writer);

    }
}
